<template>
	<view class="cdetails">
		<div class="top">
			<div class="tit">
				<h2 class="h2">合同文件模板</h2>
				<p class="p">XLS · 100KB · 文件夹名</p>
			</div>
			<div class="con">
				<u-icon name="file-text-fill" color="#52c1f5" size="140"></u-icon>
				<div class="yu">预览</div>
			</div>
			<ul class="ul">
				<li class="li">
					<p class="p1">
						上传人员
					</p>
					<p class="p2">
						<img src="../../static/my/userH.png" alt="图片请求失败" class="img" />
						赵小刚
					</p>
				</li>
				<li class="li">
					<p class="p1">文件描述</p>
					<p class="p3">添加描述</p>
				</li>
				<li class="li">
					<p class="p1">关联业务</p>
					<p class="p3">选择关联</p>
				</li>
				<li class="li">
					<p class="p1">上传事件</p>
					<p class="p2">2019-08-22 12:00</p>
				</li>
				<li class="li">
					<p class="p1">更新时间</p>
					<p class="p2">2019-08-22 12:00</p>
				</li>
			</ul>
		</div>
		<div class="bot">
			<div class="botCon">
				<div class="conTit">
					<u-icon name="bookmark-fill" color="#666666" size="28"></u-icon>
					评论列表({{list.length}})
				</div>
				<div class="time_con" v-for="item in list" :key="item.id">
					<div class="left">
						<img src="../static/my/userH.png" alt="" class="img" @click="goMy(item)" />
					</div>
					<div class="con">
						<p class="p1">
							{{item.name}}
							<view class="mm">
								销售经理
							</view>
						</p>
						<p class="p2">
							<!-- {{item.yan === '' ? '请帮同事尽快落实' : item.yan}} -->
							请帮同事尽快落实
						</p>

					</div>
					<div class="right">
						<p class="p3">
							<img src="../../static/tixk/xnxitixk/shijian.png" alt="" class="img1" />
						<p class="mn">22:31</p>
						</p>
					</div>
				</div>
			</div>
		</div>
		<div class="corss">
		</div>
		<div class="cors">
			
			<MyInput @getData="getData"></MyInput>

		</div>
	</view>
</template>

<script>
	import {
		ref,
		onMounted
	} from 'vue'
	import MyInput from '@/components/myInput.vue'

	export default {
		setup() {
			const list = ref([])
			let randomTime = []

			// const show = ref(false);
			onMounted(() => {
				getData()
			})
			const getData = () => {
				console.log('111')
				wx.request({
					url: 'http://localhost:3000/getData',
					method: 'POST',
					data: {
						// 请求参数
					},
					header: {
						// 请求头
						'content-type': 'application/json'
					},
					success: function(res) {
						const {
							data
						} = res.data
						console.log('请求成功', data);
						list.value = data
						getTime()

					},
					fail: function(err) {
						console.log('请求失败', err);
						// 处理请求失败
					}
				});
			}
			const getTime = () => {
				for (let i = 0; i < list.value.length; i++) {
					const randomDate = new Date(Math.random() * Date.now());
					randomTime.push(randomDate.toLocaleTimeString())
				}
				console.log(randomTime)
			}
			const goMy = (item) => {
				uni.navigateTo({
					url: `/pages/my/gerf/gerf?data=${JSON.stringify(item)}`
				})
			}
			return {
				list,
				randomTime,
				getData,
				getTime,
				goMy,
				// show,
			}
		},
		components: {
			MyInput
		}
	}
</script>
<style lang="scss" scoped>
	.bot {
		background-color: #f6f6f6;
		padding: 0rpx 20rpx;
	}

	.conTit {
		// padding: 20rpx 10rpx;
		padding-top: 20rpx;
		display: flex;
		align-items: center;
	}

	.time_con {
		display: flex;
		margin-top: 20rpx;
		padding: 20rpx 0rpx;
		// align-items: center;
		background-color: #ffffff;
		border-radius: 20rpx;
		box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.1);

		.img {
			width: 80rpx;
			height: 80rpx;
			border-radius: 50%;
		}

		.img1 {
			width: 30rpx;
			height: 30rpx;
		}

		// padding: 0px ;
		.p1 {
			// margin: 15rpx 0rpx;
			margin-bottom: 15rpx;
			display: flex;

			// margin-right: 10rpx;
			.mm {
				margin-left: 10rpx;
				font-size: 20rpx;
				color: #999999;
				margin-top: 5rpx;
			}
		}

		.p3 {
			// margin-top: 20rpx;
			display: flex;
			color: #99a6c4;
			align-items: center;
		}
		.con{
			// margin-right: 80rpx;
			width: 450rpx;
		}

		.left {
			margin: 10rpx 10rpx;
			// margin-right: 80rpx;
		}

		.right {
			text-align: right;
			flex: 1;
			// padding-left: 80rpx;
			// text-align: right;

		}
	}

	.corss {
		width: 100%;
		height: 100rpx;
		background-color: saddlebrown;
	}

	// .cors {
	// 	width: 100%;
	// 	height: 100rpx;
	// 	border-top: 1px solid #e4e4e4;
	// 	background-color: white;
	// 	position: fixed;
	// 	bottom: 0rpx;
	// 	padding: 15rpx 20rpx;

	// 	.inp {
	// 		width: 100%;
	// 		height: 100%;
	// 		border-radius: 40rpx;
	// 		border: 2rpx solid #e4e4e4;
	// 		display: flex;
	// 		align-items: center;
	// 		padding: 0px 10rpx;
	// 		color: #cccccc;
	// 		background-color: #f9f9f9;
	// 	}
	// }

	.img {
		width: 60rpx;
		height: 60rpx;
		border-radius: 50%;
	}

	.cdetails {
		width: 100%;
		height: 100%;
		box-sizing: border-box;

		.top {
			width: 100%;

			// background-color: saddlebrown;
			.tit {
				padding: 20rpx;

				.h2 {
					font-weight: 800;
					font-size: 40rpx;
					color: #666666;
				}

				.p {
					font-size: 27rpx;
					margin-top: 30rpx;
					color: #ccd0d6;
				}
			}

			.con {
				width: 100%;
				height: 450rpx;
				display: flex;
				flex-direction: column;
				justify-content: center;
				align-items: center;
				box-sizing: border-box;
				// background-color: saddlebrown;
				padding-bottom: 20rpx;

				.yu {
					border: 2rpx solid #0079fe;
					padding: 15rpx 40rpx;
					border-radius: 20px;
					color: #0079fe;
				}
			}

			.ul {
				width: 100%;
				height: 100%;

				.li {
					width: 100%;
					height: 100rpx;
					border: 1rpx solid #efefef;
					display: flex;
					padding: 0px 30rpx;
					justify-content: space-between;
					align-items: center;
					font-size: 30rpx;

					.p1 {
						color: #999999;
					}

					.p2 {
						color: #666666;
					}

					.p3 {
						color: #cccccc;
					}
				}
			}
		}
	}
</style>